srchr/search
inherits: can.Control
new SearchControl(element, options)
listens to a search form being submitted and
updates currentSearch with a new
[srchr/models/search Search] instance.
new srchr.search(element, options)
new SearchControl(element, options)
listens to a search form being submitted and
updates currentSearch with a new
[srchr/models/search Search] instance.
Parameters
-
element
{HTMLElement}the element to show results within.
-
options
{Object}An object of the following options:
defaultText
{String}The placeholder text.
currentSearch
{can.compute}The current search that should be performed.
If another module (ex: srchr/history) changes
currentSearch,SearchControlwill update the search form accordingly.Other features of
SearchControlinclude:Example: